package day01;

import java.io.*;

public class PrintStreamDemo01 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bin = new BufferedInputStream(new FileInputStream(new File("D:\\1\\ObjectTest.java")));
        PrintStream ps = new PrintStream(new File("D:\\1\\print.txt"));
        byte[] buff = new byte[1024];
        int len = -1;
        while((len = bin.read(buff))!=-1) {
            ps.print(new String(buff,0,len));
        }
        ps.close();
        bin.close();
    }
}
